<?php htmlTemplate('admin_header_frame.php');?>
<div class="title">用户登录统计

</div>


<table width="100%" cellspacing="1" cellpadding="3" id="listTable">
  <tbody>
    	<tr>
		<td colspan="6">
		<form action="">			
		日期：<input 
			id="c_slogin_datetime" 
			name="c_slogin_datetime" 
			type="text" 
			style="width:65px;"
			value='<?php 
			if (Http::get('c_slogin_datetime')){
				echo Http::get('c_slogin_datetime');
			}
			?>' class='date demo_time'  
			onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
			>-<input 
			id="c_elogin_datetime" 
			name="c_elogin_datetime" 
			type="text" 
			style="width:65px;"
			value='<?php 				 
			if (Http::get('c_elogin_datetime')){
				echo Http::get('c_elogin_datetime');
			}
			?>' class='date demo_time'  
			onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
			>
		<input type="submit" value="搜 索" class="btn"> 
		
		</form>
		</td>
	</tr>
  
  <tr>
  	<th align="left" width="10%">日期</th>  
    <th>登录总人数</th> 
    <th>登录总次数</th> 
    <th>平均没人登录次数</th> 
    <th>总在线时长</th> 
    <th>平均在线时长（总在线时长/总登录人数）</th>   
  </tr>

	<?php 
	$sumusernum=0;
	$sumlogtimes=0;
 	$sumonlinetime=0;
	
	
	
	
	if ($rs){
	foreach ($rs as $k=>$v):
	$sumusernum = $sumusernum+ $v['count_login_users'];
	$sumlogtimes = $sumlogtimes+ $v['count_login_datetime'];
	$sumonlinetime = $sumonlinetime+$v['sum_online_time'];
	?>
   <tr>
    <td align="left" width="10%"> <?php echo $v['login_datetime'];?></td>
    <td align="center">
	<?php echo $v['count_login_users'];?>
	</td>  
	<td align="center">
	<?php echo $v['count_login_datetime'];?>
	</td> 
	<td align="center">
	<?php echo round($v['count_login_datetime']/$v['count_login_users'],2);?>
	</td> 
	<td align="center">
	<?php echo floor($v['sum_online_time']/60);?>分钟
	</td> 
	<td align="center">
	<?php echo floor($v['sum_online_time']/$v['count_login_users']/60);?>分钟
	</td> 
	
	    
  </tr>
  <?php endforeach;}?>
  <tr style="background: #F4FAFB;">
  <td align="left">合计</td>
	<td align="center"><? if ($rs) echo $sumusernum;?></td>
	<td align="center"><? if ($rs) echo $sumlogtimes;?></td>
	<td align="center"><? if ($rs) echo round($sumlogtimes/$sumusernum,2);?></td>
	<td align="center"><? if ($rs) echo floor($sumonlinetime/60);?>分钟</td>
	<td align="center"><? if ($rs) echo floor($sumonlinetime/$sumusernum/60);?>分钟</td>
</tr>
 
 
  </tbody>
</table>
<?php htmlTemplate('admin_footer_frame.php');?>